package com.atguigu.gulimall.cart.service;

import com.atguigu.gulimall.cart.entry.vo.CartItemVo;
import com.atguigu.gulimall.cart.entry.vo.CartVo;

import java.util.List;
import java.util.concurrent.ExecutionException;

public interface CartService {
    //添加到购物车
    CartItemVo addToCart(Long skuId, Integer num) throws ExecutionException, InterruptedException;

    //获取购物车中一个购物项目
    CartItemVo getCartItem(Long skuId);

    //获取整个购物车
    CartVo getCart() throws ExecutionException, InterruptedException;

    //清空购物车
    void clearCart(String cartKey);

    //勾选购物项
    void checkItem(Long skuId, Integer check);

    //修改购物项数量
    void countItem(Long skuId, Integer num);

    //删除购物项
    void deleteItem(Long skuId);

    //获取购物车中所有选中的数据
    List<CartItemVo> getUserCartItems();
}
